<template>
  <div class="log-main">
    <div class="login-container">
      <el-form
        ref="loginForm"
        :model="loginForm"
        :rules="loginRules"
        class="login-form"
        auto-complete="on"
        label-position="left"
      >
        <div class="title-container">
          <div class="logo">
            <img src="@/assets/logo.png" alt />
            <!-- <h3 class="title">智养</h3> -->
          </div>
          <div class="tit-msg">
          </div>
        </div>
        <div class="login-box">
          <div class="input_style">
            <el-form-item prop="account">
              <span class="svg-container">
                <!-- <svg-icon icon-class="user" /> -->
                <!-- <i class="el-icon-user" style="font-size: 26px"></i> -->
                <img class="svg-container-img" src="@/assets/login/acc.png" alt="" />
              </span>
              <el-input
                ref="account"
                v-model="loginForm.account"
                placeholder="请输入用户名"
                name="account"
                type="text"
                tabindex="1"
                autocomplete="on"
                @input="loginCheck"
              />
            </el-form-item>

            <el-form-item prop="password">
              <span class="svg-container">
                <!-- <i class="el-icon-lock" style="font-size: 26px"></i> -->
                <img class="svg-container-img" src="@/assets/login/mima.png" alt="" />
              </span>
              <el-input
                :key="passwordType"
                ref="password"
                v-model="loginForm.password"
                :type="passwordType"
                placeholder="请输入密码"
                name="password"
                tabindex="2"
                autocomplete="on"
                @input="loginCheck"
                @keyup.enter.native="handleLogin(1)"
              />
              <span class="show-pwd" @click="showPwd">
                <svg-icon
                  style="color: #1f74c7"
                  :icon-class="passwordType === 'password' ? 'eye' : 'eye-open'"
                />
              </span>
            </el-form-item>
            <el-form-item style="height: 43px;">
              <!-- prop="inputCode" <div class="identifyCode">
                <el-input
                  v-model="loginForm.inputCode"
                  placeholder="请输入验证码"
                  type="text"
                  tabindex="1"
                  autocomplete="on"
                  @keyup.enter.native="handleLogin(1)"
                />
                <div class="identifyCode-main" @click="refreshCode()">
                  <SecurityCode
                    :identify-code="identifyCode"
                    :content-height="47"
                  />
                </div>
              </div>-->
              <SliderCheck ref="slider" />
              <!--验证码组件-->
            </el-form-item>
            <!-- <div v-else style="height: 47px;"></div> -->
          </div>
          <div class="login-bottom">
            <div class="new-msg">
              <div class="rember-msg">
                <el-checkbox v-model="remberMsg" label="记住密码" />
              </div>
              <div
                class="forget-msg"
                @click.stop="forget"
              >忘记密码</div>
            </div>
            <el-button
              :loading="loading"
              type="primary"
              style=" width: 40%;
                margin-bottom: 10px;
                background-color: #1f74c7;
                height: 40px;
                font-size: 18px;
                position: relative;
                float: right;
              "
              @click.native.prevent="handleLogin(1)"
            >登录</el-button>
            <div class="reg-user" @click="toreguser()">注册</div>
          </div>
        </div>
      </el-form>
    </div>
    <div class="copyright">
      版权所有：中科台达（浙江）信息技术有限公司｜ Copyright © 2019-2025
      casdelta.com All Right Reserved
      <br />
      <a
        href="https://beian.miit.gov.cn"
        target="view_window"
      >ICP备案号：浙ICP备19034790号-5</a>
    </div>
    <!-- 特殊 -->
    <!-- <div class="copyright">
      版权所有：COPYRIGHT © 渔雅科技（上海）有限公司
      <br />
      <a href="https://beian.miit.gov.cn" target="view_window">
        ICP备案号：沪ICP备20003371号-1</a>
    </div>-->
    <div class="future">
      <img src="@/assets/login/future.png" class="futureback" alt />
      <div class="futurecenter">Future</div>
    </div>

    <div class="smart">
      <img src="@/assets/login/smart.png" class="smartback" alt />
      <div class="smartcenter">Smart</div>
    </div>

    <div class="data">
      <img src="@/assets/login/data.png" class="databack" alt />
      <div class="datacenter">数字化</div>
    </div>

    <div class="weather">
      <img src="@/assets/login/weatherbor.png" class="weatherback" alt />
      <img src="@/assets/login/weather.png" class="weathercenter" alt />
    </div>
    <div class="tv">
      <img src="@/assets/login/tvbor.png" class="tvback" alt />
      <img src="@/assets/login/tv.png" class="tvcenter" alt />
    </div>

    <div class="green">
      <img src="@/assets/login/green.png" class="greenback" alt />
      <div class="greencenter">Green</div>
    </div>

    <div class="iot">
      <img src="@/assets/login/iot.png" class="iotback" alt />
      <div class="iotcenter">物联网</div>
    </div>
    <div class="qixiang">
      <img src="@/assets/login/qi.png" class="qiback" alt />
      <div class="qicenter">气象</div>
    </div>

    <div class="oc">
      <img src="@/assets/login/ocbor.png" class="ocback" alt />
      <img src="@/assets/login/oc.png" class="occenter" alt />
    </div>

    <div class="fisheries">
      <img src="@/assets/login/fisheries.png" class="fisheriesback" alt />
      <div class="fisheriescenter">Fisheries</div>
    </div>
  </div>
</template>

<script>
// import { validUsername } from "@/utils/validate";
import userService from "@/api/user/index";
import SliderCheck from "@/components/securityCode/SliderCheck";
import { removeloToken, setloToken } from "@/utils/loginAuth";
import { setToken, getToken } from "@/utils/auth";
import { getCookie, setCookie, getpasCookie } from "@/utils/cookie";
// import store from "@/store";

// import SecurityCode from "@/components/securityCode/securityCode";
export default {
  name: "Login",
  components: {
    // SecurityCode
    SliderCheck
  },
  data() {
    const validateUsername = (rule, value, callback) => {
      if (!value) {
        callback(new Error("请输入用户名"));
      } else {
        callback();
      }
    };
    const validatePassword = (rule, value, callback) => {
      if (value.length < 6) {
        callback(new Error("密码不得小于六位"));
      } else {
        callback();
      }
    };
    const validateinputCode = (rule, value, callback) => {
      if (!value) {
        callback(new Error("请输入验证码（区分大小写）"));
      } else if (this.identifyCode !== this.loginForm.inputCode) {
        this.$set(this.loginForm, "inputCode", "");
        this.refreshCode();
        callback(new Error("请输入正确的验证码"));
      } else {
        callback();
      }
    };
    return {
      remberMsg: false,
      loginForm: {
        // account: "jg",
        // password: "123456"
        account: "",
        password: "",
        inputCode: undefined
      },
      loginRules: {
        account: [
          { required: true, trigger: "blur", validator: validateUsername }
        ],
        password: [
          { required: true, trigger: "blur", validator: validatePassword }
        ],
        inputCode: [
          { required: true, validator: validateinputCode, trigger: "blur" }
        ]
      },
      loading: false,
      passwordType: "password",
      redirect: undefined,
      identifyCodeType: "1234567890", // 定义验证类型 1.数字 2.字母
      identifyCode: "",
      inputCode: "", // text框输入的验证码
      // 状态为1时为非直接登录 需要滑动验证
      inputStuats: 1
    };
  },
  watch: {
    $route: {
      handler: function(route) {
        this.redirect = route.query && route.query.redirect;
      },
      immediate: true
    }
  },
  mounted() {
    // 跳转过来时清除sessionStorage
    sessionStorage.clear();
    // 判断sessionStorage 有没有记住密码
    if (localStorage.remberMsg === "true") {
      this.remberMsg = true;
    }
    this.getquery();
    this.refreshCode();
  },
  created() {
    // 刷新页面
    if (this.$store.state.permission.addRoutes.length > 0) {
      // 判断是否已经刷新
      location.reload();
    }
  },
  destroyed() {
    if (localStorage.remberMsg !== "true") {
      setCookie(this.loginForm.account, this.loginForm.password, -1);
    }
  },
  methods: {
    loginCheck() {
      // this.inputStuats = 2;
      // setTimeout(() => {
      //   this.inputStuats = 1;
      // }, 5);
      this.$refs.slider.init();
    },
    // 随机验证码
    randomNum(min, max) {
      return Math.floor(Math.random() * (max - min) + min);
    },
    // 初始化验证码
    refreshCode() {
      this.identifyCode = ""; // 输入框置空
      this.makeCode(this.identifyCodeType, 4); // 验证码长度为4
    },
    // 随机切换验证码
    makeCode(o, l) {
      for (let i = 0; i < l; i++) {
        this.identifyCode += this.identifyCodeType[
          this.randomNum(0, this.identifyCodeType.length)
        ];
      }
      // console.log(this.identifyCode);
    },
    getquery() {
      let tr = this.$route.query;
      console.log(this.$route);
      // console.log(this.inputStuats)
      // 判断是不是账号密码登录
      if (tr.farmingTypeNo) {
        setToken("farmingTypeNo", tr.farmingTypeNo);
      }
      if (tr.entrance_flag) {
        setToken("entrance_flag", tr.entrance_flag);
      }
      if (tr && tr.account) {
        // console.log(this)
        this.inputStuats = 2;
        // console.log(tr);
        this.loginForm.account = decodeURIComponent(tr.account);
        this.$set(this.loginForm, "username", this.loginForm.account);
        this.loginForm.password = tr.password;

        if (!getToken('entrance_flag')) {
          setToken("entrance_flag", 'CN');
        }

        setTimeout(() => {
          this.handleLogin(2);
        }, 200);
        // 判断是不是加密账号密码登录
      } else if (tr.token) {
        // 避免明文 url 链接
        this.inputStuats = 2;
        let token = decodeURIComponent(
          window.location.href.split("?")[1].split("=")[1]
        ).replace(/ /g, "+");
        let obj = getpasCookie(token);
        this.loginForm.account = obj.account;
        this.loginForm.username = obj.account;
        this.loginForm.password = obj.password;

        if (!getToken('entrance_flag')) {
          setToken("entrance_flag", 'CN');
        }

        setTimeout(() => {
          this.handleLogin(2);
        }, 200);
        // 判断cookie 是否有保账号密码
      } else if (this.remberMsg === true) {
        this.inputStuats = 2;
        // 从cookie 获取
        let loginForm = getCookie();
        // 进行赋值
        if (!loginForm) {
          this.inputStuats = 1;
          return;
        }
        this.$set(this.loginForm, "account", loginForm.account);
        this.$set(this.loginForm, "username", loginForm.account);
        this.$set(this.loginForm, "password", loginForm.password);
        this.handleLogin(2);
        // this.inputStuats = 1;
      } else {
        this.inputStuats = 1;
      }
    },
    // 注册用户
    toreguser() {
      this.$router.push({ path: "/register-user" });
    },
    forget() {
      this.$router.push({ path: "/find-password" });
    },
    showPwd() {
      if (this.passwordType === "password") {
        this.passwordType = "";
      } else {
        this.passwordType = "password";
      }
      this.$nextTick(() => {
        this.$refs.password.focus();
      });
    },
    handleLogin(e) {
      this.$refs.loginForm.validate(valid => {
        if (valid) {
          // 滑动验证码
          if (this.inputStuats === 1) {
            // 未通过验证时，提示错误信息并返回
            if (!this.$refs["slider"].confirmSuccess) {
              this.$message.error("请拖动滑块验证");
              return;
            }
          }
          this.loading = true;
          this.$store
            .dispatch("user/login", this.loginForm)
            .then(() => {
              this.loading = false;
              // 存储加密账号密码到cookie
              if (this.remberMsg) {
                setCookie(this.loginForm.account, this.loginForm.password, 15);
                setloToken("remberMsg", this.remberMsg);
              } else {
                removeloToken("remberMsg");
              }
              // -------------------------------------------------------------
              // -----------------------------------------------------------
              // 更新时需要注释
              // setToken("databaseName", "DB_TDW1_COMMON");
              // setToken("organizationList", "YS");
              // setToken("organizationNo", "YS");
              // setToken("systemMark", "ZY");
              // setToken("virtualSystemNo", "ZY");
              // setToken("breedTypeNo", "sheep");
              if (getToken('entrance_flag') !== 'ZM' && getToken('databaseName') && getToken('organizationNo') && !getToken('virtualSystemNo')) {
                this.$router.push({ path: "/choose-company" });
                // this.$router.push({ name: "ZhControlView" });
              } else if (getToken('entrance_flag') !== 'ZM' && getToken('databaseName') && getToken('organizationNo')) {
                // this.$router.push({ path: "/choose-company" });
                this.$router.push({ name: "ZhControlView" });
              } else {
                setToken("entrance_flag", 'ZM');
                this.$router.push({ path: "/choose-company" });
              }
              // 测试
              // if (this.nowmenutype) {
              //   store.dispatch("permission/generateRoutes").then(res => {
              //     // console.log(res);
              //     this.$router.push({
              //       name: `${res[0].children[0].name}`
              //     });
              //     // console.log(this.$store.state.permission.pageElementList, 'pageElementList');
              //     // userService
              //     //   .queryPageElement(item.virtualSystemNo)
              //     //   .then(eleres => {});
              //   });
              // } else {
              // this.$router.push({ name: "ZhControlView" });
              // }
            })
            .catch(err => {
              this.$message.warning(
                err ||
                  "用户账号/密码错误(或已被加入黑名单),请确认后重试或联系管理员"
              );
              this.loading = false;
            });
        } else {
          console.log("表单提交错误!!");
          return false;
        }
      });
    },
    // 主要用于登录完判断进入哪个页面--暂时没什么用
    gotoview() {
      // 获取顶级组织结构id,
      userService.organizationTop().then(res => {
        let companylist = res.data;
        alert(companylist.length);
        if (companylist.length > 1) {
          this.$router.push({
            path: "/select-farm",
            query: { id: companylist[0]["companyId"] }
          });
        } else if (companylist.length === 1) {
          this.$router.push({
            path: "/choose-company",
            query: { id: companylist[0]["companyId"] }
          });
        }
      });

      this.loading = false;
    }
  }
};
</script>

<style lang="scss">
@import "~@/styles/variables.scss";

/* 修复input 背景不协调 和光标变色 */
/* Detail see https://github.com/PanJiaChen/vue-element-admin/pull/927 */

$bg: #283443;
$light_gray: $appMainTextColor;
$cursor: $appMainTextColor;

@supports (-webkit-mask: none) and (not (cater-color: $cursor)) {
  .login-container .el-input input {
    color: $cursor;
  }
}
/* 登录主体样式 */
.login-container {
  .el-input {
    display: inline-block;
    height: 47px;
    width: 85%;
    input {
      background: transparent;
      border: 0px;
      appearance: none;
      -webkit-appearance: none;
      border-radius: 0px;
      padding: 12px 5px 12px 15px;
      color: $light_gray;
      height: 47px;
      caret-color: $cursor;
      &:-webkit-autofill {
        box-shadow: 0 0 0px 1000px $bg inset !important;
        -webkit-text-fill-color: $cursor !important;
      }
    }
  }

  .el-form-item {
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.1);
    border-radius: 5px;
    color: #454545;
  }
}
</style>
<style lang="scss" scoped>
@import "~@/styles/variables.scss";

$bg: #2d3a4b;
$dark_gray: #889aa4;
$light_gray: #eee;
.log-main {
  width: 100%;
  height: 100%;
  background: linear-gradient(
    150.62deg,
    #b0c9e8,#d1dcef 100%,#c4daef 0);
  overflow: hidden;
  position: relative;
  // overflow:auto;
  // overflow: hidden;
  // overflow-y: hidden;
  // overflow-x: hidden;
  // -ms-overflow-style: auto;
}
// .log-main::-webkit-scrollbar { width: 0 !important }
.identifyCode {
  width: 100%;
  display: flex;
  .identifyCode-main {
    height: 47px;
  }
}
.login-container {
  min-height: 100%;
  width: 100%;
  background-size: 100% 100% !important;
  background-attachment: fixed !important;
  background: url("~@/assets/login/backs.png") center center no-repeat;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  .login-form {
    overflow: hidden;
    position: relative;
    width: 565px;
    height: 346px;
    max-width: 100%;
    top: -20px;
    margin: auto;
    // overflow: hidden;
    background-color: rgba(255, 255, 255, 1);
    z-index: 99;
    display: flex;
    .login-bottom {
      width: 100%;
      position: absolute;
      bottom: 0;
      padding: 0 35px;
      width: 100%;
      box-sizing: border-box;
      .svg-container {
        color: rgba(127, 211, 84);
        height: 100%;
      }
      ::v-deep .el-input input {
        caret-color: #1f74c7;
        margin-left: 10px;
        outline: none !important;
        border: none !important;
        padding: 0 !important;
        color: $bg;
      }
      // 自动填充样式input,真恶心
      ::v-deep .el-input {
        .el-input__inner:-webkit-autofill,
        .el-input__inner:-webkit-autofill:hover,
        .el-input__inner:-webkit-autofill:active,
        .el-input__inner:-webkit-autofill {
          margin-left: 15px;
          outline: none !important;
          border: none !important;
          padding: 0 !important;
          height: 100%;

          -webkit-box-shadow: 0 0 0px 1000px rgb(246, 246, 246) inset !important;
          box-shadow: 0 0 0px 1000px rgb(246, 246, 246) inset !important;
          -webkit-text-fill-color: #2d3a4b !important;
        }
      }
      ::v-deep .el-form-item__content {
        border: 1px solid rgba(217, 217, 217, 1);
        border-radius: 2px;
        background-color: $appMainTextColor;
      }
      // 记住密码与忘记密码
      .new-msg {
        display: flex;
        margin-bottom: 20px;
        width: 100%;
        justify-content: space-between;
        .rember-msg {
          width: 80px;
          height: 22px;
          color: rgba(255, 255, 255, 0.65);
          font-size: 14px;
          line-height: 22px;
          .el-checkbox {
            color: rgb(163 155 155);
            font-size: 14px;
          }
          ::v-deep .el-checkbox__input.is-checked + .el-checkbox__label {
            color: #1f74c7;
          }
          ::v-deep .el-checkbox__input.is-checked .el-checkbox__inner,
          .el-checkbox__input.is-indeterminate .el-checkbox__inner {
            background-color: #1f74c7;
            border-color: #1f74c7;
          }
        }
        .forget-msg {
          margin-right: 35px;
          width: 56px;
          height: 22px;
          color: #1f74c7;
          font-size: 14px;
          line-height: 22px;
          cursor: pointer;
          position: absolute;
          right: 0;
        }
      }
    }
  }
  .tips {
    font-size: 14px;
    color: $appMainTextColor;
    margin-bottom: 10px;

    span {
      &:first-of-type {
        margin-right: 16px;
      }
    }
  }

  .svg-container {
    padding: 9px 5px 6px 15px;
    color: $dark_gray;
    vertical-align: middle;
    width: 28px;
    display: inline-block;
    height: 100%;

  }

  .title-container {
    // margin-top: 28px;
    position: relative;
    // top: 18px;
    background: #77ace0;
    height: 100%;
    min-width:42%;
    .logo {
      text-align: center;
      display: flex;
      flex-wrap: nowrap;
      align-items: center;
      justify-content: center;
      // width: 120px;
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      img {
        width: 120px;
        border-radius: 6px;
        // box-shadow:  -1px 2px 8px 1px #00000080;
      }
      .title {
        font-size: 26px;
        color: #fff;
        // margin: 20px auto 2px auto;
        margin-left: 10px;
        text-align: center;
        font-weight: bold;
        white-space: nowrap;
      }
    }
    .tit-msg {
      color: rgba(255, 255, 255, 0.56);
      text-align: center;
      // margin-bottom: 35px;
      // background: url("~@/assets/login/yang-5.png") bottom center no-repeat;
      position: absolute;
      bottom: 0;
      width: 100%;
      // background-position: auto center;
      background-size: auto;
      min-height: 40%;
    }
  }
  .login-box {
    width:58%;
    position: relative;
    padding-top: 30px;
  }
  .input_style {
    padding: 0 35px;
    width: 100%;
    box-sizing: border-box;
    .svg-container {
      color: rgba(127, 211, 84);

      .svg-container-img {
        height: 22px;
        width: 18px;
      }
    }
    ::v-deep .el-input input {
      caret-color: #1f74c7;
      margin-left: 10px;
      outline: none !important;
      border: none !important;
      padding: 0 !important;
      color: $bg;
      height: 100%;
    }
    // 自动填充样式input,真恶心
    ::v-deep .el-input {
      .el-input__inner:-webkit-autofill,
      .el-input__inner:-webkit-autofill:hover,
      .el-input__inner:-webkit-autofill:active,
      .el-input__inner:-webkit-autofill {
        margin-left: 10px;
        outline: none !important;
        border: none !important;
        padding: 0 !important;
        height: 100%;

        -webkit-box-shadow: 0 0 0px 1000px rgb(255, 255, 255) inset !important;
        box-shadow: 0 0 0px 1000px rgb(255, 255, 255) inset !important;
        -webkit-text-fill-color: #2d3a4b !important;
      }
    }
    ::v-deep .el-form-item__content {
      border: 1px solid rgba(217, 217, 217, 1);
      border-radius: 2px;
      background-color: $appMainTextColor;
        height: 100%;
      line-height: 16px;

    }
    // 记住密码与忘记密码
    .new-msg {
      display: flex;
      margin-bottom: 20px;
      width: 100%;
      justify-content: space-between;
      .rember-msg {
        width: 80px;
        height: 22px;
        color: rgba(255, 255, 255, 0.65);
        font-size: 14px;
        line-height: 22px;
        .el-checkbox {
          color: rgba(163, 155 ,155);
          font-size: 14px;
        }
        ::v-deep .el-checkbox__input.is-checked + .el-checkbox__label {
          color: #1f74c7;
        }
        ::v-deep .el-checkbox__input.is-checked .el-checkbox__inner,
        .el-checkbox__input.is-indeterminate .el-checkbox__inner {
          background-color: #1f74c7;
          border-color: #1f74c7;
        }
      }
      .forget-msg {
        margin-right: 35px;
        width: 56px;
        height: 22px;
        color: #1f74c7;
        font-size: 14px;
        line-height: 22px;
        cursor: pointer;
      }
    }
  }
  .show-pwd {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    color: $dark_gray;
    cursor: pointer;
    user-select: none;
  }
  .reg-user {
    width: 40%;
    margin-bottom: 10px;
    background-color: transparent;
    height: 40px;
    font-size: 18px;
    position: relative;
    text-align: center;
    line-height: 38px;
    color: #1f74c7;
    border: 1px solid #1f74c7;
    border-radius: 5px;
    cursor: pointer;
  }
}
</style>
<style lang="scss" scoped>
@import "~@/styles/variables.scss";

.copyright {
  width: 100%;
  position: absolute;
  bottom: 0px;
  text-align: center;
  color: white;
  line-height: 2;
  font-size: 10px;
  margin-bottom: 0;
  background-color: rgba(32, 3, 4, 0.35);
}

.future {
  position: absolute;
  top: 23%;
  left: 27%;
  display: flex;
  justify-content: center;
  align-items: center;
  .futureback {
    width: 270px;
    position: absolute;
    animation: upmove 15s linear infinite;
    -moz-animation: upmove 15s linear infinite; /* Firefox */
    -webkit-animation: upmove 15s linear infinite; /* Safari and Chrome */
    -o-animation: upmove 15s linear infinite; /* Opera */
  }
  .futurecenter {
    font-size: 42px;
    color: $appMainTextColor;
  }
}
.smart {
  position: absolute;
  top: 69%;
  left: 20%;
  display: flex;
  justify-content: center;
  align-items: center;
  .smartback {
    width: 300px;
    position: absolute;
    animation: upmove 8s linear infinite;
    -moz-animation: upmove 8s linear infinite; /* Firefox */
    -webkit-animation: upmove 8s linear infinite; /* Safari and Chrome */
    -o-animation: upmove 8s linear infinite; /* Opera */
  }
  .smartcenter {
    font-size: 35px;
    color: $appMainTextColor;
  }
}

.data {
  position: absolute;
  top: 72%;
  left: 75%;
  display: flex;
  justify-content: center;
  align-items: center;
  .databack {
    width: 350px;
    position: absolute;
    animation: upmove 10s linear infinite;
    -moz-animation: upmove 10s linear infinite; /* Firefox */
    -webkit-animation: upmove 10s linear infinite; /* Safari and Chrome */
    -o-animation: upmove 10s linear infinite; /* Opera */
  }
  .datacenter {
    font-size: 35px;
    color: $appMainTextColor;
  }
}
.weather {
  position: absolute;
  top: 45%;
  left: 82.1%;
  display: flex;
  justify-content: center;
  align-items: center;
  .weatherback {
    width: 210px;
    position: absolute;
    animation: upmove 8s linear infinite;
    -moz-animation: upmove 8s linear infinite; /* Firefox */
    -webkit-animation: upmove 8s linear infinite; /* Safari and Chrome */
    -o-animation: upmove 8s linear infinite; /* Opera */
  }
  .weathercenter {
    color: $appMainTextColor;
  }
}
.tv {
  position: absolute;
  top: 82%;
  left: 38%;
  display: flex;
  justify-content: center;
  align-items: center;
  .tvback {
    width: 160px;
    position: absolute;
    animation: mymove 5s ease-in-out infinite;
    -moz-animation: mymove 5s ease-in-out infinite; /* Firefox */
    -webkit-animation: mymove 5s ease-in-out infinite; /* Safari and Chrome */
    -o-animation: mymove 5s ease-in-out infinite; /* Opera */
  }
}

.green {
  position: absolute;
  top: 23%;
  left: 88%;
  display: flex;
  justify-content: center;
  align-items: center;
  .greenback {
    width: 180px;
    position: absolute;
    animation: upmove 8s linear infinite;
    -moz-animation: upmove 8s linear infinite; /* Firefox */
    -webkit-animation: upmove 8s linear infinite; /* Safari and Chrome */
    -o-animation: upmove 8s linear infinite; /* Opera */
  }
  .greencenter {
    font-size: 25px;
    color: $appMainTextColor;
  }
}

.iot {
  position: absolute;
  top: 16%;
  left: 66%;
  display: flex;
  justify-content: center;
  align-items: center;
  .iotback {
    width: 185px;
    position: absolute;
    animation: upmove 15s linear infinite;
    -moz-animation: upmove 15s linear infinite; /* Firefox */
    -webkit-animation: upmove 15s linear infinite; /* Safari and Chrome */
    -o-animation: upmove 15s linear infinite; /* Opera */
  }
  .iotcenter {
    font-size: 30px;
    color: $appMainTextColor;
  }
}
.qixiang {
  position: absolute;
  top: 79%;
  left: 12%;
  display: flex;
  justify-content: center;
  align-items: center;
  .qiback {
    width: 110px;
    position: absolute;
    animation: upmove 15s linear infinite;
    -moz-animation: upmove 15s linear infinite; /* Firefox */
    -webkit-animation: upmove 15s linear infinite; /* Safari and Chrome */
    -o-animation: upmove 15s linear infinite; /* Opera */
  }
  .qicenter {
    font-size: 20px;
    color: $appMainTextColor;
  }
}

.oc {
  position: absolute;
  top: 18%;
  left: 10%;
  display: flex;
  justify-content: center;
  align-items: center;
  .ocback {
    width: 70px;
    position: absolute;
    animation: mymove 5s ease-in-out infinite;
    -moz-animation: mymove 5s ease-in-out infinite; /* Firefox */
    -webkit-animation: mymove 5s ease-in-out infinite; /* Safari and Chrome */
    -o-animation: mymove 5s ease-in-out infinite; /* Opera */
  }
}

.fisheries {
  position: absolute;
  top: 40%;
  left: 9%;
  display: flex;
  justify-content: center;
  align-items: center;
  .fisheriesback {
    width: 180px;
    position: absolute;
    animation: mymove 5s ease-in-out infinite;
    -moz-animation: mymove 5s ease-in-out infinite; /* Firefox */
    -webkit-animation: mymove 5s ease-in-out infinite; /* Safari and Chrome */
    -o-animation: mymove 5s ease-in-out infinite; /* Opera */
  }
  .fisheriescenter {
    font-size: 24px;
    color: $appMainTextColor;
  }
}
@keyframes upmove {
  0% {
    transform: rotateZ(0deg);
    -webkit-transform: rotateZ(0deg);
    -moz-transform: rotateZ(0deg);
    -o-transform: rotateZ(0deg);
    -ms-transform: rotateZ(0deg);
  }
  100% {
    transform: rotateZ(360deg);
    -webkit-transform: rotateZ(360deg);
    -moz-transform: rotateZ(360deg);
    -o-transform: rotateZ(360deg);
    -ms-transform: rotateZ(360deg);
  }
}
@keyframes mymove {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    //  background-position: 100% 0%;
    transform: scale(1.2);
    opacity: 1;
  }
  100% {
    //  background-position: 100% 0%;
    transform: scale(1);
    opacity: 1;
  }
}
</style>
